package com.rwcw.admin.config.exception;

import com.rwcw.admin.vo.ResultVO;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class AdminExceptionHandler {
    @ResponseBody
    @ExceptionHandler(AdminException.class)
    public ResultVO<?> adminExceptionHandler(AdminException exception) {
                return new ResultVO<>(500, exception.getMessage());
    }
}
